//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS CloudSearch service.
///
/// Amazon CloudSearch Configuration Service You use the Amazon CloudSearch configuration service to create, configure, and manage search domains. Configuration service  requests are submitted using the AWS Query protocol. AWS Query requests are HTTP or HTTPS requests submitted via HTTP GET or POST with a query parameter named Action. The endpoint for configuration service requests is region-specific: cloudsearch.region.amazonaws.com. For example, cloudsearch.us-east-1.amazonaws.com. For a current list of supported regions and endpoints, see Regions and Endpoints.
public struct CloudSearch: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the CloudSearch client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "CloudSearch",
            serviceIdentifier: "cloudsearch",
            serviceProtocol: .query,
            apiVersion: "2013-01-01",
            endpoint: endpoint,
            errorType: CloudSearchErrorType.self,
            xmlNamespace: "http://cloudsearch.amazonaws.com/doc/2013-01-01/",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }





    // MARK: API Calls

    /// Indexes the search suggestions. For more information, see Configuring Suggesters in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func buildSuggesters(_ input: BuildSuggestersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> BuildSuggestersResponse {
        try await self.client.execute(
            operation: "BuildSuggesters", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Indexes the search suggestions. For more information, see Configuring Suggesters in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func buildSuggesters(
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> BuildSuggestersResponse {
        let input = BuildSuggestersRequest(
            domainName: domainName
        )
        return try await self.buildSuggesters(input, logger: logger)
    }

    /// Creates a new search domain. For more information, see Creating a Search Domain in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func createDomain(_ input: CreateDomainRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateDomainResponse {
        try await self.client.execute(
            operation: "CreateDomain", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new search domain. For more information, see Creating a Search Domain in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: A name for the domain you are creating. Allowed characters are a-z (lower-case letters), 0-9, and hyphen (-). Domain names must start with a letter or number and be at least 3 and no more than 28 characters long.
    ///   - logger: Logger use during operation
    @inlinable
    public func createDomain(
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateDomainResponse {
        let input = CreateDomainRequest(
            domainName: domainName
        )
        return try await self.createDomain(input, logger: logger)
    }

    /// Configures an analysis scheme that can be applied to a text or text-array field to define language-specific text processing options. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func defineAnalysisScheme(_ input: DefineAnalysisSchemeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DefineAnalysisSchemeResponse {
        try await self.client.execute(
            operation: "DefineAnalysisScheme", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures an analysis scheme that can be applied to a text or text-array field to define language-specific text processing options. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - analysisScheme: 
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func defineAnalysisScheme(
        analysisScheme: AnalysisScheme,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DefineAnalysisSchemeResponse {
        let input = DefineAnalysisSchemeRequest(
            analysisScheme: analysisScheme, 
            domainName: domainName
        )
        return try await self.defineAnalysisScheme(input, logger: logger)
    }

    /// Configures an Expression for the search domain. Used to create new expressions and modify existing ones.  If the expression exists, the new configuration replaces the old one. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func defineExpression(_ input: DefineExpressionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DefineExpressionResponse {
        try await self.client.execute(
            operation: "DefineExpression", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures an Expression for the search domain. Used to create new expressions and modify existing ones.  If the expression exists, the new configuration replaces the old one. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - expression: 
    ///   - logger: Logger use during operation
    @inlinable
    public func defineExpression(
        domainName: String,
        expression: Expression,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DefineExpressionResponse {
        let input = DefineExpressionRequest(
            domainName: domainName, 
            expression: expression
        )
        return try await self.defineExpression(input, logger: logger)
    }

    /// Configures an IndexField for the search domain. Used to create new fields and modify existing ones. You must specify the name of the domain you are configuring and an index field configuration. The index field configuration specifies a unique name, the index field type, and the options you want to configure for the field. The options you can specify depend on the IndexFieldType. If the field exists, the new configuration replaces the old one. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func defineIndexField(_ input: DefineIndexFieldRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DefineIndexFieldResponse {
        try await self.client.execute(
            operation: "DefineIndexField", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures an IndexField for the search domain. Used to create new fields and modify existing ones. You must specify the name of the domain you are configuring and an index field configuration. The index field configuration specifies a unique name, the index field type, and the options you want to configure for the field. The options you can specify depend on the IndexFieldType. If the field exists, the new configuration replaces the old one. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - indexField: The index field and field options you want to configure.
    ///   - logger: Logger use during operation
    @inlinable
    public func defineIndexField(
        domainName: String,
        indexField: IndexField,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DefineIndexFieldResponse {
        let input = DefineIndexFieldRequest(
            domainName: domainName, 
            indexField: indexField
        )
        return try await self.defineIndexField(input, logger: logger)
    }

    /// Configures a suggester for a domain. A suggester enables you to display possible matches before users finish typing their queries. When you configure a suggester, you must specify the name of the text field you want to search for possible matches and a unique name for the suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func defineSuggester(_ input: DefineSuggesterRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DefineSuggesterResponse {
        try await self.client.execute(
            operation: "DefineSuggester", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures a suggester for a domain. A suggester enables you to display possible matches before users finish typing their queries. When you configure a suggester, you must specify the name of the text field you want to search for possible matches and a unique name for the suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - suggester: 
    ///   - logger: Logger use during operation
    @inlinable
    public func defineSuggester(
        domainName: String,
        suggester: Suggester,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DefineSuggesterResponse {
        let input = DefineSuggesterRequest(
            domainName: domainName, 
            suggester: suggester
        )
        return try await self.defineSuggester(input, logger: logger)
    }

    /// Deletes an analysis scheme. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func deleteAnalysisScheme(_ input: DeleteAnalysisSchemeRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteAnalysisSchemeResponse {
        try await self.client.execute(
            operation: "DeleteAnalysisScheme", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an analysis scheme. For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - analysisSchemeName: The name of the analysis scheme you want to delete.
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteAnalysisScheme(
        analysisSchemeName: String,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteAnalysisSchemeResponse {
        let input = DeleteAnalysisSchemeRequest(
            analysisSchemeName: analysisSchemeName, 
            domainName: domainName
        )
        return try await self.deleteAnalysisScheme(input, logger: logger)
    }

    /// Permanently deletes a search domain and all of its data. Once a domain has been deleted, it cannot be recovered. For more information, see Deleting a Search  Domain in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func deleteDomain(_ input: DeleteDomainRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteDomainResponse {
        try await self.client.execute(
            operation: "DeleteDomain", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Permanently deletes a search domain and all of its data. Once a domain has been deleted, it cannot be recovered. For more information, see Deleting a Search  Domain in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: The name of the domain you want to permanently delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteDomain(
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteDomainResponse {
        let input = DeleteDomainRequest(
            domainName: domainName
        )
        return try await self.deleteDomain(input, logger: logger)
    }

    /// Removes an Expression from the search domain. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func deleteExpression(_ input: DeleteExpressionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteExpressionResponse {
        try await self.client.execute(
            operation: "DeleteExpression", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes an Expression from the search domain. For more information, see Configuring Expressions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - expressionName: The name of the Expression to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteExpression(
        domainName: String,
        expressionName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteExpressionResponse {
        let input = DeleteExpressionRequest(
            domainName: domainName, 
            expressionName: expressionName
        )
        return try await self.deleteExpression(input, logger: logger)
    }

    /// Removes an IndexField from the search domain. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func deleteIndexField(_ input: DeleteIndexFieldRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteIndexFieldResponse {
        try await self.client.execute(
            operation: "DeleteIndexField", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes an IndexField from the search domain. For more information, see Configuring Index Fields in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - indexFieldName: The name of the index field your want to remove from the domain's indexing options.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteIndexField(
        domainName: String,
        indexFieldName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteIndexFieldResponse {
        let input = DeleteIndexFieldRequest(
            domainName: domainName, 
            indexFieldName: indexFieldName
        )
        return try await self.deleteIndexField(input, logger: logger)
    }

    /// Deletes a suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func deleteSuggester(_ input: DeleteSuggesterRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteSuggesterResponse {
        try await self.client.execute(
            operation: "DeleteSuggester", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a suggester. For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - suggesterName: Specifies the name of the suggester you want to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteSuggester(
        domainName: String,
        suggesterName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteSuggesterResponse {
        let input = DeleteSuggesterRequest(
            domainName: domainName, 
            suggesterName: suggesterName
        )
        return try await self.deleteSuggester(input, logger: logger)
    }

    /// Gets the analysis schemes configured for a domain. An analysis scheme defines language-specific text processing options for a text field. Can be limited to specific analysis schemes by name.  By default, shows all analysis schemes and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes.  For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeAnalysisSchemes(_ input: DescribeAnalysisSchemesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeAnalysisSchemesResponse {
        try await self.client.execute(
            operation: "DescribeAnalysisSchemes", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the analysis schemes configured for a domain. An analysis scheme defines language-specific text processing options for a text field. Can be limited to specific analysis schemes by name.  By default, shows all analysis schemes and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes.  For more information, see Configuring Analysis Schemes in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - analysisSchemeNames: The analysis schemes you want to describe.
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeAnalysisSchemes(
        analysisSchemeNames: [String]? = nil,
        deployed: Bool? = nil,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeAnalysisSchemesResponse {
        let input = DescribeAnalysisSchemesRequest(
            analysisSchemeNames: analysisSchemeNames, 
            deployed: deployed, 
            domainName: domainName
        )
        return try await self.describeAnalysisSchemes(input, logger: logger)
    }

    /// Gets the availability options configured for a domain. By default, shows the configuration with any pending changes. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see  Configuring Availability Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeAvailabilityOptions(_ input: DescribeAvailabilityOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeAvailabilityOptionsResponse {
        try await self.client.execute(
            operation: "DescribeAvailabilityOptions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the availability options configured for a domain. By default, shows the configuration with any pending changes. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see  Configuring Availability Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeAvailabilityOptions(
        deployed: Bool? = nil,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeAvailabilityOptionsResponse {
        let input = DescribeAvailabilityOptionsRequest(
            deployed: deployed, 
            domainName: domainName
        )
        return try await self.describeAvailabilityOptions(input, logger: logger)
    }

    /// Returns the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see  Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeDomainEndpointOptions(_ input: DescribeDomainEndpointOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeDomainEndpointOptionsResponse {
        try await self.client.execute(
            operation: "DescribeDomainEndpointOptions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Returns the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see  Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to retrieve the latest configuration (which might be in a Processing state) or the current, active configuration. Defaults to false.
    ///   - domainName: A string that represents the name of a domain.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeDomainEndpointOptions(
        deployed: Bool? = nil,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeDomainEndpointOptionsResponse {
        let input = DescribeDomainEndpointOptionsRequest(
            deployed: deployed, 
            domainName: domainName
        )
        return try await self.describeDomainEndpointOptions(input, logger: logger)
    }

    /// Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default. To get the number of searchable documents in a domain, use the console or submit a matchall request to your domain's search endpoint: q=matchall&amp;q.parser=structured&amp;size=0. For more information, see Getting Information about a Search Domain in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeDomains(_ input: DescribeDomainsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeDomainsResponse {
        try await self.client.execute(
            operation: "DescribeDomains", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the search domains owned by this account. Can be limited to specific domains. Shows all domains by default. To get the number of searchable documents in a domain, use the console or submit a matchall request to your domain's search endpoint: q=matchall&amp;q.parser=structured&amp;size=0. For more information, see Getting Information about a Search Domain in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainNames: The names of the domains you want to include in the response.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeDomains(
        domainNames: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeDomainsResponse {
        let input = DescribeDomainsRequest(
            domainNames: domainNames
        )
        return try await self.describeDomains(input, logger: logger)
    }

    /// Gets the expressions configured for the search domain. Can be limited to specific expressions by name. By default, shows all expressions and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see  Configuring Expressions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeExpressions(_ input: DescribeExpressionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeExpressionsResponse {
        try await self.client.execute(
            operation: "DescribeExpressions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the expressions configured for the search domain. Can be limited to specific expressions by name. By default, shows all expressions and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see  Configuring Expressions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - expressionNames: Limits the DescribeExpressions response to the specified expressions. If not specified, all expressions are shown.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeExpressions(
        deployed: Bool? = nil,
        domainName: String,
        expressionNames: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeExpressionsResponse {
        let input = DescribeExpressionsRequest(
            deployed: deployed, 
            domainName: domainName, 
            expressionNames: expressionNames
        )
        return try await self.describeExpressions(input, logger: logger)
    }

    /// Gets information about the index fields configured for the search domain. Can be limited to specific fields by name.  By default, shows all fields and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see Getting Domain Information in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeIndexFields(_ input: DescribeIndexFieldsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeIndexFieldsResponse {
        try await self.client.execute(
            operation: "DescribeIndexFields", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the index fields configured for the search domain. Can be limited to specific fields by name.  By default, shows all fields and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see Getting Domain Information in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - fieldNames: A list of the index fields you want to describe. If not specified, information is returned for all configured index fields.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeIndexFields(
        deployed: Bool? = nil,
        domainName: String,
        fieldNames: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeIndexFieldsResponse {
        let input = DescribeIndexFieldsRequest(
            deployed: deployed, 
            domainName: domainName, 
            fieldNames: fieldNames
        )
        return try await self.describeIndexFields(input, logger: logger)
    }

    /// Gets the scaling parameters configured for a domain. A domain's scaling parameters specify the desired search instance type and replication count. For more information, see   Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeScalingParameters(_ input: DescribeScalingParametersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeScalingParametersResponse {
        try await self.client.execute(
            operation: "DescribeScalingParameters", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the scaling parameters configured for a domain. A domain's scaling parameters specify the desired search instance type and replication count. For more information, see   Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func describeScalingParameters(
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeScalingParametersResponse {
        let input = DescribeScalingParametersRequest(
            domainName: domainName
        )
        return try await self.describeScalingParameters(input, logger: logger)
    }

    /// Gets information about the access policies that control access to the domain's document and search endpoints. By default, shows the configuration with any pending changes. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see Configuring Access for a Search Domain in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeServiceAccessPolicies(_ input: DescribeServiceAccessPoliciesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeServiceAccessPoliciesResponse {
        try await self.client.execute(
            operation: "DescribeServiceAccessPolicies", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets information about the access policies that control access to the domain's document and search endpoints. By default, shows the configuration with any pending changes. Set the Deployed option to true to show the active configuration and exclude pending changes. For more information, see Configuring Access for a Search Domain in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeServiceAccessPolicies(
        deployed: Bool? = nil,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeServiceAccessPoliciesResponse {
        let input = DescribeServiceAccessPoliciesRequest(
            deployed: deployed, 
            domainName: domainName
        )
        return try await self.describeServiceAccessPolicies(input, logger: logger)
    }

    /// Gets the suggesters configured for a domain. A suggester enables you to display possible matches before users finish typing their queries.  Can be limited to specific suggesters by name.  By default, shows all suggesters and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes.  For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func describeSuggesters(_ input: DescribeSuggestersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeSuggestersResponse {
        try await self.client.execute(
            operation: "DescribeSuggesters", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the suggesters configured for a domain. A suggester enables you to display possible matches before users finish typing their queries.  Can be limited to specific suggesters by name.  By default, shows all suggesters and includes any pending changes to the configuration. Set the Deployed option to true to show the active configuration and exclude pending changes.  For more information, see Getting Search Suggestions in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - deployed: Whether to display the deployed configuration (true) or include any pending changes (false). Defaults to false.
    ///   - domainName: The name of the domain you want to describe.
    ///   - suggesterNames: The suggesters you want to describe.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeSuggesters(
        deployed: Bool? = nil,
        domainName: String,
        suggesterNames: [String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeSuggestersResponse {
        let input = DescribeSuggestersRequest(
            deployed: deployed, 
            domainName: domainName, 
            suggesterNames: suggesterNames
        )
        return try await self.describeSuggesters(input, logger: logger)
    }

    /// Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is  RequiresIndexDocuments.
    @Sendable
    @inlinable
    public func indexDocuments(_ input: IndexDocumentsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> IndexDocumentsResponse {
        try await self.client.execute(
            operation: "IndexDocuments", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tells the search domain to start indexing its documents using the latest indexing options. This operation must be invoked to activate options whose OptionStatus is  RequiresIndexDocuments.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func indexDocuments(
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> IndexDocumentsResponse {
        let input = IndexDocumentsRequest(
            domainName: domainName
        )
        return try await self.indexDocuments(input, logger: logger)
    }

    /// Lists all search domains owned by an account.
    @Sendable
    @inlinable
    public func listDomainNames(logger: Logger = AWSClient.loggingDisabled) async throws -> ListDomainNamesResponse {
        try await self.client.execute(
            operation: "ListDomainNames", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            logger: logger
        )
    }

    /// Configures the availability options for a domain. Enabling the Multi-AZ option expands an Amazon CloudSearch domain to an additional Availability Zone in the same Region to increase fault tolerance in the event of a service disruption. Changes to the Multi-AZ option can take about half an hour to become active. For more information, see Configuring Availability Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func updateAvailabilityOptions(_ input: UpdateAvailabilityOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateAvailabilityOptionsResponse {
        try await self.client.execute(
            operation: "UpdateAvailabilityOptions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures the availability options for a domain. Enabling the Multi-AZ option expands an Amazon CloudSearch domain to an additional Availability Zone in the same Region to increase fault tolerance in the event of a service disruption. Changes to the Multi-AZ option can take about half an hour to become active. For more information, see Configuring Availability Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - multiAZ: You expand an existing search domain to a second Availability Zone by setting the Multi-AZ option to true. Similarly, you can turn off the Multi-AZ option to downgrade the domain to a single Availability Zone by setting the Multi-AZ option to false.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateAvailabilityOptions(
        domainName: String,
        multiAZ: Bool,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateAvailabilityOptionsResponse {
        let input = UpdateAvailabilityOptionsRequest(
            domainName: domainName, 
            multiAZ: multiAZ
        )
        return try await self.updateAvailabilityOptions(input, logger: logger)
    }

    /// Updates the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func updateDomainEndpointOptions(_ input: UpdateDomainEndpointOptionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateDomainEndpointOptionsResponse {
        try await self.client.execute(
            operation: "UpdateDomainEndpointOptions", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the domain's endpoint options, specifically whether all requests to the domain must arrive over HTTPS. For more information, see Configuring Domain Endpoint Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainEndpointOptions: Whether to require that all requests to the domain arrive over HTTPS. We recommend Policy-Min-TLS-1-2-2019-07 for TLSSecurityPolicy. For compatibility with older clients, the default is Policy-Min-TLS-1-0-2019-07.
    ///   - domainName: A string that represents the name of a domain.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateDomainEndpointOptions(
        domainEndpointOptions: DomainEndpointOptions,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateDomainEndpointOptionsResponse {
        let input = UpdateDomainEndpointOptionsRequest(
            domainEndpointOptions: domainEndpointOptions, 
            domainName: domainName
        )
        return try await self.updateDomainEndpointOptions(input, logger: logger)
    }

    /// Configures scaling parameters for a domain. A domain's scaling parameters specify the desired search instance type and replication count. Amazon CloudSearch will still automatically scale your domain based on the volume of data and traffic, but not below the desired instance type and replication count. If the Multi-AZ option is enabled, these values control the resources used per Availability Zone. For more information, see Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
    @Sendable
    @inlinable
    public func updateScalingParameters(_ input: UpdateScalingParametersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateScalingParametersResponse {
        try await self.client.execute(
            operation: "UpdateScalingParameters", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures scaling parameters for a domain. A domain's scaling parameters specify the desired search instance type and replication count. Amazon CloudSearch will still automatically scale your domain based on the volume of data and traffic, but not below the desired instance type and replication count. If the Multi-AZ option is enabled, these values control the resources used per Availability Zone. For more information, see Configuring Scaling Options in the Amazon CloudSearch Developer Guide.
    ///
    /// Parameters:
    ///   - domainName: 
    ///   - scalingParameters: 
    ///   - logger: Logger use during operation
    @inlinable
    public func updateScalingParameters(
        domainName: String,
        scalingParameters: ScalingParameters,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateScalingParametersResponse {
        let input = UpdateScalingParametersRequest(
            domainName: domainName, 
            scalingParameters: scalingParameters
        )
        return try await self.updateScalingParameters(input, logger: logger)
    }

    /// Configures the access rules that control access to the domain's document and search endpoints. For more information, see  Configuring Access for an Amazon CloudSearch Domain.
    @Sendable
    @inlinable
    public func updateServiceAccessPolicies(_ input: UpdateServiceAccessPoliciesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateServiceAccessPoliciesResponse {
        try await self.client.execute(
            operation: "UpdateServiceAccessPolicies", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Configures the access rules that control access to the domain's document and search endpoints. For more information, see  Configuring Access for an Amazon CloudSearch Domain.
    ///
    /// Parameters:
    ///   - accessPolicies: The access rules you want to configure. These rules replace any existing rules.
    ///   - domainName: 
    ///   - logger: Logger use during operation
    @inlinable
    public func updateServiceAccessPolicies(
        accessPolicies: String,
        domainName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateServiceAccessPoliciesResponse {
        let input = UpdateServiceAccessPoliciesRequest(
            accessPolicies: accessPolicies, 
            domainName: domainName
        )
        return try await self.updateServiceAccessPolicies(input, logger: logger)
    }
}

extension CloudSearch {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: CloudSearch, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
